#include "../../src/xege.h"
#include "../../src/event.hpp"
#include <cstdio>
#include <thread>
#include <cmath>
#include <ctime>
#include "../../include/fmt/format.h"
#include <random>

constexpr inline POINTD direct2Length (double offsetx, double offsety, double rad, double length) {
	return { offsetx + cos (rad)*length, offsety + sin (rad)*length };
}

struct BALL {
	BALL () {
		x = 0;
	}
	double x, y, xv, yv;
};

int main (int argc, char **argv) {

	SDL_Log ("WINDOW OPENING");
	WINDOW win (1000, 1000);
	SDL_Log ("WINDOW OPENED");
	
	SDL_Event *event = new SDL_Event;
	SDL_EventType *unused;

	std::vector <POINT> balls (200);

	for (; win.isRun () ; win.update ().clear (), delay_fps (60)) {
		switch (SDL_PollEvent (event); event -> type) {
			case SDL_QUIT: {
				SDL_Log ("WINDOW CLOSED");
				// isrun = false;
				win.close ();
				SDL_Quit ();
			} break;
			default : {
			} break;
		}
	}
	return 0;
} 

